<%-- 
    Document   : displayConferenceItem
    Created on : Dec 3, 2012, 10:02:05 PM
    Author     : Pk
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Display Conference Item Details</title>
        <sj:head/>
         <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"> </script>
     
        <script type="text/javascript">
            $(document).ready(function() {
                $("#registerBtn").click(function(){
                    var count =0 ;
                    $('[id^="conferenceItem_"]').each(function(index) {
                        
                        if($(this).attr("checked")) count++;
                    });
                    
                    if (count!=0)
                    $("#submitBtn").click();
                    
                })
            });
        </script>
        
    </head>
    <body>
        <s:form name="myform" action="%{actionType}ConferenceItemBooking">
            
            <table align="center" cellpadding="5">
                <tr>
                    <td colspan="4">*select all the events you want to register for</td>
                </tr>
                <s:iterator value="conferenceItemList" var="conf">
                    <tr>
                        <td colspan="4"><h3><s:checkbox name="itemList" fieldValue="%{id}" id="conferenceItem_%{id}"/>&nbsp;&nbsp;<s:property value="#conf.conferenceItemType.name" /></h3></td>                        
                    </tr>
                    <tr>
                        <td><h4>Topic</h4></td>
                        <td colspan="3"><h4>: <s:property value="#conf.topic" /></h4></td>
                    </tr>
                    <tr>
                        <td colspan="4"><s:property value="#conf.description" /></td>
                    </tr>
                    <tr>
                        <td align="right">Start Date</td>
                        <td>: <s:property value="#conf.startDate" /></td>
                        <td align="right">End Date:</td>
                        <td>: <s:property value="#conf.endDate" /></td>
                    </tr>                    

                </s:iterator>
                    <tr>
                    <td colspan="4" align="right"><input type="button" id="registerBtn" value="Register"><s:submit id="submitBtn" value="Register" onclick="document.myform.submit()" cssStyle="display:none"/></td>
                    </tr>
            </table>             
        </s:form>
    </body>
</html>
